fn hello() {
    println('hello nature')
    throw 'world error'
}

var err = try hello()
if err.has {
    println('catch err:', err.msg)
}

fn one(bool need):int {
    if need {
        throw 'i am one error'
    }
    return 2
}

var (s, err) = try one(true)
if err.has {
    println('one(true) has err:', err.msg)
} else {
    println('one(true) not err, s=', s)
}

var (s1, err) = try one(false)
if err.has {
    println('one(false) has err:', err.msg)
} else {
    println('one(false) not err, s1=', s1)
}